#include "logger.h"

using namespace std;

class Sorter {
 public:
   Sorter();

   ~Sorter();

   // Main function for sort (at this moment it does not actually sorts array)
   bool sort(char* source_file, char* destination_file);

 private:
   // File mapper instances
   FileIO *source_file_mapper_, *dest_file_mapper_;

   // Logger instance
   Logger *_logger;

   // Buffers for input and output
   char* input_buffer, output_buffer;

   // Size of source file
   DWORD _dw_file_size_low, _dw_file_size_high;

   // Initialize data. Returns true if succeed
   bool init(char* source_file, char* destination_file);

   // Converts char* to wchar_t*
   void toWchar(char* str, wchar_t* result);

   void merge(int n_of_buffers);

   // Get name of temporary file number n
   void getTempName(int n, wchar_t* tmp_name);

   void addNumber(int* numbers, int* number, int* n_of_numbers);
};